package cn.cool.trigger.http;

import cn.cool.api.dto.NotifyRequestDTO;
import cn.hutool.json.JSONUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/api/v1/test/")
@RequiredArgsConstructor
//http://127.0.0.1:8091/api/test/group_buy_notify"
public class TestApiClientController {

    @PostMapping("group_buy_notify")
    public String groupBuyNotify(@RequestBody NotifyRequestDTO notifyRequestDTO) {
        log.info("模拟测试第三方服务接受拼团回调 {}", JSONUtil.toJsonStr(notifyRequestDTO));
        return "success";
    }
}
